#include "util.hpp"
#include <iostream>  // 确保包含iostream头文件

void FileUtilTest(const std::string &filename)
{
/*    
    cloud::FileUtil fu(filename);
    
    /
    std::cout << fu.FileSize() << std::endl;
    
    std::cout << fu.LastMTime() << std::endl;
    std::cout << fu.LastATime() << std::endl;
    return;
	
	cloud::FileUtil fu(filename);
	std::string body;
	fu.GetContent(&body);

	cloud::FileUtil nfu("./hello.txt");
	nfu.SetContent(body);
	
	std::string packname=filename+".lz";
	cloud::FileUtil fu(filename);
	fu.Compress(packname);
	cloud::FileUtil pfu(packname);
	pfu.UnCompress("./hello.txt");
	*/
	cloud::FileUtil fu(filename);
	fu.CreateDirectory();
	std::vector<std::string> arry;
	fu.ScanDirectory(&arry);
	for(auto &a:arry)
	{
		std::cout<<a<<std::endl;
	}
	return ;
}

int main(int argc, char* argv[])
{
    // 增加参数检查，避免访问未定义的argv[1]
    if (argc < 2) {
        std::cerr << "用法: " << argv[0] << " <文件名>" << std::endl;
        return 1;
    }
    
    FileUtilTest(argv[1]);
    return 0;
}
